/*
 * Copyright [2022] [https://www.xiaonuo.vip]
 *
 * Snowy采用APACHE LICENSE 2.0开源协议，您在使用过程中，需要注意以下几点：
 *
 * 1.请不要删除和修改根目录下的LICENSE文件。
 * 2.请不要删除和修改Snowy源码头部的版权声明。
 * 3.本项目代码可免费商业使用，商业使用请保留源码和相关描述文件的项目出处，作者声明等。
 * 4.分发源码时候，请注明软件出处 https://www.xiaonuo.vip
 * 5.不可二次分发开源参与同类竞品，如有想法可联系团队xiaonuobase@qq.com商议合作。
 * 6.若您的项目无法满足以上几点，需要更多功能代码，获取Snowy商业授权许可，请在官网购买授权，地址为 https://www.xiaonuo.vip
 */
package vip.xiaonuo.biz.modular.cabinetdoor.vo;

import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import springfox.documentation.annotations.ApiIgnore;

/**
 * 柜门
 *
 * @author kongxm
 * @date 2022/11/06 21:07
 **/
@Data
public class ClientCabinetDoorDetail {
    @TableId
    @ApiModelProperty(value = "柜门id")
    private String cabinetDoorId;

    @ApiModelProperty(value = "柜门编号")
    private String cabinetDoorCode;

    @ApiModelProperty(value = "柜门名称")
    private String cabinetDoorName;

    @ApiModelProperty(value = "0-物品 1-试剂")
    private Integer cabinetDoorType;

    @ApiModelProperty(value = "试剂总重量string")
    private String reagentTotalWeigh;

    @JsonIgnore
    private String reagentStorageType;

    @ApiModelProperty(value = "存放试剂类型")
    private String reagentStorageTypeName;

    @ApiModelProperty(value = "柜子编号")
    private String cabinetCode;

    @ApiModelProperty(value = "柜子名称")
    private String cabinetName;

    @ApiModelProperty(value = "存放总数")
    private Integer totalStock;

    @ApiModelProperty(value = "当前在库")
    private Integer currentStock;

    @ApiModelProperty(value = "当前借出")
    private Integer currentBorrowed;

    @ApiModelProperty(value = "是否拥有许可")
    private Boolean hasPerm;

    @JsonIgnore
    private Boolean separatedPermission;
    private String cabinetId;
    private String cabinetGroupId;
    private String cabinetGroupName;
    private Integer maxPermDays;
    /**
     * 组柜的区域
     */
    @JsonIgnore
    private String cabinetGroupAreaName;
    @JsonIgnore
    private String cabinetGroupBuildingName;
    @JsonIgnore
    private String cabinetGroupRoomName;
    @JsonIgnore
    private String cabinetGroupRemark;
    @JsonIgnore
    private String cabinetGroupComment;
    @JsonIgnore
    private String cabinetGroupOrgName;
    @JsonIgnore
    private String cabinetGroupAdminUserNames;
    /**
     * 柜子的区域
     */
    @JsonIgnore
    private String cabinetInfoAreaName;
    @JsonIgnore
    private String cabinetInfoBuildingName;
    @JsonIgnore
    private String cabinetInfoRoomName;
    @JsonIgnore
    private String cabinetInfoRemark;
    @JsonIgnore
    private String cabinetInfoComment;
    @JsonIgnore
    private String cabinetInfoOrgName;
    @JsonIgnore
    private String cabinetInfoAdminUserNames;


    @ApiModelProperty(value = "存放地点-区域")
    public String getAreaName() {
        return StringUtils.isNotEmpty(cabinetInfoAreaName) ? cabinetInfoAreaName : cabinetGroupAreaName;
    }

    @ApiModelProperty(value = "存放地点-楼栋")
    public String getBuildingName() {
        return StringUtils.isNotEmpty(cabinetInfoBuildingName) ? cabinetInfoBuildingName : cabinetGroupBuildingName;
    }

    @ApiModelProperty(value = "存放地点-房间")
    public String getRoomName() {
        return StringUtils.isNotEmpty(cabinetInfoRoomName) ? cabinetInfoRoomName : cabinetGroupRoomName;
    }

    @ApiModelProperty(value = "备注")
    public String getRemark() {
        return StringUtils.isNotEmpty(cabinetInfoRemark) ? cabinetInfoRemark : cabinetGroupRemark;
    }

    @ApiModelProperty(value = "柜子描述")
    public String getCabinetComment() {
        return StringUtils.isNotEmpty(cabinetInfoComment) ? cabinetInfoComment : cabinetGroupComment;
    }

    @ApiModelProperty(value = "所属组织")
    public String getOrgName() {
        return StringUtils.isNotEmpty(cabinetInfoOrgName) ? cabinetInfoOrgName : cabinetGroupOrgName;
    }

    @ApiModelProperty(value = "柜门管理员")
    public String getAdminUserNames() {
        return StringUtils.isNotEmpty(cabinetInfoAdminUserNames) ? cabinetInfoAdminUserNames : cabinetGroupAdminUserNames;
    }
}
